<template>
  <section class="app-container calendar-list-container" v-loading="loading">
    <section class="container-header">
      <p class="header-title">{{ info.questionnaire_title }}</p>
      <p class="header-content">{{ info.questionnaire_desc }}</p>
    </section>
    <section class="container-table">
      <div class="question-box" v-for="(item, index) in tableList" :key="index">
        <!-- <p class="question-title">{{ item.questionnaire_title }}<span>[单选题]</span></p> -->
        <p class="question-title">{{ item.questionnaire_title }}</p>
        <div class="redio-box" v-if="item.question_type==1 || item.question_type==2" v-for="(it, ix) in item.questionnaireOptions" :key="ix">
          <el-radio label="1">{{ it.questionnaire_option }}</el-radio>
        </div>
        <div class="redio-boxa score-box"  v-if="item.question_type==3">
          <div class="score-box" style="width:500px">
            <el-slider v-model="value1"></el-slider>
          </div>
        </div>
        <div class="redio-boxa"  v-if="item.question_type==4">
          <div class="score-box">
            <el-input style="width:600px" placeholder="请输入内容"></el-input>
          </div>
        </div>
      </div>
    </section>
  </section>
</template>

<script>
import { questionnaire_dataStatisticsById } from "@/api/questionnaire";
import SoPagination from "@/components/SoPagination";

export default {
  name: "detailed",
  components: { SoPagination },
  data() {
    return {
      loading: false,
      listQuery: { start: 0, limit: 10, total: 0, current: 1 },
      tableList: [],
      info: {},
      value1:10
    };
  },
  methods: {
    //获取数据
    async initList() {
      this.loading = true;
      const query = { id: this.$route.query.id, company_id: localStorage.getItem("companyId") - 0 };
      const { data } = await questionnaire_dataStatisticsById(query);
      this.loading = false;
      if (data.status == 100) {
        this.info = data.data;
        this.tableList = data.data.questionnaireQess
      }
    }
  },
  created() {
    this.initList();
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.container-header {
  background-color: #fff;
  padding: 40px;
  margin-bottom: 10px;
  .header-title {
    font-size: 24px;
  }
  .header-content {
    font-size: 18px;
    padding-top: 40px;
  }
}
.container-table {
  background-color: #fff;
  padding: 40px;
  .question-box {
    font-size: 18px;
    padding-bottom: 40px;
  }
  .question-title {
    padding: 10px 0;
    span {
      padding-left: 50px;
    }
  }
  .redio-box {
    padding-left: 20px;
  }
}
.score-box {
  margin: 0 20px;
}
</style>
